#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
#include <climits>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <deque>

#define quickio ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define endl "\n"

using namespace std;
typedef long long ll;

vector<string>ans;

void dfs(string a, string b, string c, int n)
{
	if (!n)
		return;
	dfs(a, c, b, n - 1);
	ans.push_back(a + "->" + c);
	dfs(b, a, c, n - 1);
}

int main()
{
	int n;
	cin >> n;
	dfs("A", "B", "C", n);
	for (auto e : ans)
		cout << e << endl;
	return 0;
}